package com.longcai.controller.fuyoupay;


import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.longcai.bean.ApiResult;
import com.longcai.entity.payment.fuyou.request.ClyjFuyouAgencyPay;
import com.longcai.entity.payment.fuyou.request.ClyjFuyouAgencyRecord;
import com.longcai.service.fuyoupay.ClyjFuyouAgencyPayService;
import com.longcai.service.fuyoupay.ClyjFuyouAgencyRecordService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author f
 * @since 2019-04-22
 */
@Controller
@RequestMapping("/clyjFuyouAgencyRecord")
public class ClyjFuyouAgencyRecordController {
	@Autowired  
	private ClyjFuyouAgencyRecordService cyjFuyouAgencyRecordService;
	@RequestMapping("/agencyPaySave")
	@ResponseBody
	public ApiResult<?> recharge (@RequestBody JSONObject params){
		ClyjFuyouAgencyRecord cfar=cyjFuyouAgencyRecordService.checkout(params);
		if (cfar!=null) {
			boolean b = cyjFuyouAgencyRecordService.insert(cfar);
			if(b){
				return ApiResult.success("提现成功");
			}
		}
		return ApiResult.fail("提现失败");
	}
}

